var request;
function showDetail(id){
	var url = "servlet/adminShowDetail?id=" + id;
	var content = document.getElementById("feedbackAll");
	content.innerHTML = "<div style='height:90px; padding-top:20px'><img src='admin/img/loading.gif' /></div>";
	if(window.XMLHttpRequest){
		request = new XMLHttpRequest();
	} else if (window.ActiveXObject){
		request = new ActiveXObject();
	}
	
	if (request) {
		request.open("POST",url,true);
		request.onreadystatechange = complete;
		request.send(null); 
	}
}
function complete(){
	if(request.readyState == 4){
		if(request.status == 200){
			var items = request.responseText.split("|||");
			var title = items[0];
			var time = items[1];
			var author = items[2];
			var content = items[3];
			var content1 = document.getElementById("feedbackAll");
			content1.innerHTML = "<div id='title' style='font-weight:bold; padding-top:10px'>" + title + "</div><div style='height:5px; border-top:1px solid #CCCCCC; margin-top:5px; margin-right:15px; margin-left:15px'></div><div style='color: #666666'>反馈时间：" + time + "</div><div style='margin-top:10px; margin-bottom:10px; text-align:left'>" + content + "</div><div style='margin-left:300px; margin-top:5px; margin-bottom:5px;'>反馈者：" + author + "</div>";
		}
	}
}

function deleteFeedback(item) {
	var id = item.title
	if(confirm("确认删除？")){
		var form = document.createElement("form");
		form.action = "admin-deleteFeedbackById.htm";
		form.method="post";
		form.innerHTML = "<input type='hidden' value='" + id + "' name='id'/>"
		form.submit();
	} else {
		return
	}
}

function submitForm(page){
	var form = document.createElement("form");
	form.action="admin-searchFeedbacks.htm";
	form.method="post";
	var message = document.getElementById("message").title
	form.innerHTML = "<input type='hidden' name='keyword' value='" + message + "'/><input type='hidden' name='currentPage' value='" + page + "' />";
	form.submit();
}